<script >
  import title1 from '../components/title.vue'
  import Navigation from '../components/navigation_tea.vue'
  import { ElMessage } from 'element-plus'
  export default {
    name: 'tea_submitc',
    components:
    {
      title1,
      Navigation
    },
    data(){
      return{
        sel_cyear:'',
        cyear,
        Cname:'',
        ctype,
        sel_ctype:'',
        UserNo:'',
        }
      },
    created() {
      // 访问全局属性
      this.UserNo = this.$root.$UserNo;
    },
    mounted() {
      document.title = '教师信息管理系统';
      const token = localStorage.getItem('token'); // 确保 token 已正确存储
      const userNo = sessionStorage.getItem('UserNo'); // 确保 UserNo 已正确存储
      if (!token || !userNo) {
        alert('缺少必要的认证信息，请重新登录。');
        this.$router.push({ name: "Login" });
      }
    },
    }
  const ctype = [
    {
      value: '1',
      label: '基础课',
    },
    {
      value: '2',
      label: '专业课',
    },
    {
      value: '3',
      label: '通识课',
    },
  ]
  const cyear = [
    {
      value: '24年秋',
      label: '24秋',
    },
    {
      value: '24年春',
      label: '24春',
    },
    {
      value: '23年秋',
      label: '23秋',
    },
    {
      value: '23年春',
      label: '23春',
    },
    {
      value: '22年秋',
      label: '22秋',
    },
    {
      value: '22年春',
      label: '22春',
    },
  ]
</script>

<template>
  <text class="sub-title"> — 提交授课申请</text>
  <title1></title1>
  <Navigation></Navigation>
  <text style="position: fixed;top: 130px;left:750px;font-size: larger;font-weight: bold;">编辑所授课程信息</text>
  <el-container style="position: fixed;top: 180px;left: 500px;">
    <el-text >开课学年学期:</el-text>
    <el-tree-select
        v-model="sel_cyear"
        :data="cyear"
        :render-after-expand="false"
        style="width: 190px;margin-left: 10px"
    />
    <el-text style="margin-left: 45px">所开课程类型:</el-text>
    <el-tree-select
        v-model="sel_ctype"
        :data="ctype"
        :render-after-expand="false"
        style="width: 180px;margin-left: 10px"
    />
  </el-container>
  <el-container style="position: fixed;top: 240px;left: 500px;">
    <el-text>输入开课名称:</el-text>
    <el-input v-model="Cname" style=" margin-left:10px;width: 180px" placeholder="eg:微积分" />
    <el-text style="margin-left: 55px;">输入课程学分:</el-text>
    <el-input v-model="Ccredit" style="margin-left:10px;width: 180px" placeholder="eg:2.5" />
  </el-container>
  <el-container style="position: fixed;top: 300px;left: 500px;">
    <el-text>开课时间地点:</el-text>
    <el-input v-model="Ctp" style=" margin-left:10px;width: 180px" placeholder="eg:周四4-5/南110" />
    <el-text style="margin-left: 55px;">输入课程容量:</el-text>
    <el-input v-model="Chold" style="margin-left:10px;width: 180px" placeholder="eg:30" />
  </el-container>
  <el-container style="position: fixed;top: 360px;left: 500px;">
    <el-text style="margin-left: 55px;">备注:</el-text>
    <el-input v-model="extra_text" style="margin-left:10px;width: 520px" placeholder="" />
  </el-container>
  <el-button plain @click="submit" style="margin-left: 50px">
    申请
  </el-button>
</template>

<style scoped>
.sub-title{
  z-index: 2;
  position: fixed;
  top: 35px;
  left: 380px;
  color: #0e4bbd;
  font-size: 30px;
  font-weight: normal;
}

</style>